<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>广告投放</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,address=no"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../css/common.css"/>
    <link rel="stylesheet" href="../js/drop/dropload.css" />
    <link rel="stylesheet" href="../css/main.css"/>
    <style>
        .ad_list .item + .item{
            border-top: 1px solid #e5e5e5;
        }
    </style>
</head>
<body>
<section class="tabBar">
    <div class=" flex lh90 tac col9 bw" id="tabs">
        <div class="flex1 active item" data-status="">全部</div>
        <div class="flex1 item" data-status="1">审核中</div>
        <div class="flex1 item" data-status="2">待投放</div>
        <div class="flex1 item" data-status="3">投放中</div>
        <div class="flex1 item" data-status="4">已结束</div>
        <div class="flex1 item" data-status="5">审核失败</div>
    </div>
    <div class="h10 bgf5"></div>
</section>
<section class="container pt100 pb130">
    <div class="ad_list plr24 bw">
        <!--<li class="flex_sb ptb20 item">-->
            <!--<div>-->
                <!--<p>广告名称:44343</p>-->
                <!--<p class="col9 mt10 font13">2018-06-06 12:12:12</p>-->
            <!--</div>-->
            <!--<span class="color4">审核中</span>-->
        <!--</li>-->
        <!--<li class="flex_sb ptb20 item">-->
            <!--<div>-->
                <!--<p>广告名称:44343</p>-->
                <!--<p class="col9 mt10 font13">2018-06-06 12:12:12</p>-->
            <!--</div>-->
            <!--<span class="color3">投放中</span>-->
        <!--</li>-->
        <!--<li class="flex_sb ptb20 item">-->
            <!--<div>-->
                <!--<p>广告名称:44343</p>-->
                <!--<p class="col9 mt10 font13">2018-06-06 12:12:12</p>-->
            <!--</div>-->
            <!--<span class="color2">失败</span>-->
        <!--</li>-->
        <!--<li class="flex_sb ptb20 item">-->
            <!--<div>-->
                <!--<p>广告名称:44343</p>-->
                <!--<p class="col9 mt10 font13">2018-06-06 12:12:12</p>-->
            <!--</div>-->
            <!--<span class="color5">待投放</span>-->
        <!--</li>-->
        <!--<li class="flex_sb ptb20 item">-->
            <!--<div>-->
                <!--<p>广告名称:44343</p>-->
                <!--<p class="col9 mt10 font13">2018-06-06 12:12:12</p>-->
            <!--</div>-->
            <!--<span class="col9">已结束</span>-->
        <!--</li>-->
    </div>
</section>
<footer class="ptb20 pos_f bottom0 pw100 bgf5">
    <div class="plr30">
        <a href="./ad_add.html" class="border-r6 bgc1 colw tac lh90 pw100 btn_tap db">新增广告</a>
    </div>
</footer>
</body>
</html>
<script src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../js/drop/dropload.min.js"></script>
<script src="../js/dlc.js"></script>
<script>
    var status = '';
    get_list();
    $('#tabs').on('click','.item',function(){
        $(this).addClass('active').siblings().removeClass('active');
        status = $(this).data('status');
        get_list();
    });
    function get_list(){
        var data = {
            'page':1,
            'limit':999
        };
        if(status){
            data.status = status;
        }
        dlc_request('/api/advertising/advertisingList',data,function(res){
            console.log(res);
            if(res.code == 1){
                var list = res.page.list;
                var str = '';
                for(var i in list){
                    str+='<a href="./ad_details.html?id='+list[i].id+'" class="flex_sb ptb20 item">'+
                            '<div>'+
                            '<p><span class="mr10">广告名称:</span>'+list[i].name+'</p>'+
                            '<p class="col9 mt10 font13">'+format(list[i].createTime,'Y-m-d H:i:s')+'</p>'+
                            '</div>'+
                            '<span class="'+(list[i].status==1?'color4':list[i].status==2?'color5':list[i].status==3?'color3':list[i].status==4?'col9':'color2')+'">'+(list[i].status==1?'审核中':list[i].status==2?'待投放':list[i].status==3?'投放中':list[i].status==4?'已结束':list[i].status==5?'审核失败':'未知错误')+'</span>'+
                            '</a>';
                }
                if(str){
                    $('.ad_list').css('background','#fff').html(str);
                }else{
                    $('.ad_list').css('background','#f1f1f1').html(emptyTip('暂无记录'));
                }
            }else{
                dlctipbox.show(res.msg);
            }
        });
    }
</script>






















